import java.util.Scanner;

public class jiecheng {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数字");
        int d = sc.nextInt();
        System.out.println(jie(d));
    }
    public static int jie(int n){
        int sum=0;
        int k = 1;
        for(int i = 1;i<=n;i++){
                k*=i;
                sum+=k;
        }
        return sum;
    }
}

